"""
__author__ = 'berlinyoung'
@File   :contact_page.py
@Date   :2022/5/9 16:48
-*- coding: utf-8 -*-
"""
from selenium.webdriver.common.by import By

from weixin_web.step1.po.add_member_page import AddMemberPage
from weixin_web.step1.po.base import Base


class ContactPage(Base):
    _base_url = "https://work.weixin.qq.com/wework_admin/frame#contacts"
    def get_contact_list(self):
        name_list = []
        eles = self.finds(By.CSS_SELECTOR,".member_colRight_memberTable_td:nth-child(2)")
        for value in eles:
            name_list.append(value.get_attribute("title"))
        return  name_list

    def goto_add_member(self):
        '''
        跳转到添加成员页面
        :return:
        '''
        return AddMemberPage(self.driver)